package movie.alipay;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016101100662059";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCQImALwsVopm3MGXcZ+XVAmebUAY25hlHhvuHfUrUCGz/ivm5LXg3ym/OOKpxKF2qo/8oTOp7acuwnFiB56H4Wzdxy163iyVf5yYLTraLpSePU/FIucXBLM+nqhNLGgt7NiE495ah2yp0Q/CuZXdDHPOe24s/tEMtj6VNlj5O4zqnUWn+xtLptpLlfI1rEeZmrkCaTzrtCOkC1GFK1b+pAmCtoUilLQRmUSmgzHMMTy+NcJyn0u4B+b5nXtv9BPbo36e69ee8C4KBgRM73xY8hfX1e/uP44uGqH4bk0CC6KR0cIszNTl3dqvHamof07jn/rxzaojxd9MmooK03/R3fAgMBAAECggEAXAAVHmysZSgWXXjDtSit1xZlaF21gP5jtZyJwGqibz3FgY3cCO94J6uzwsMgD4ry4fyjl7KLQxSn+Cr/f9EO6q9sT0GsFF5AcYhWoZbrrc0kSAbmzg5KhzYT0UYG4/8VCExA5PF6npiluPm9Op/Pa91MakhMQB3ANX3xZZpHyGXqevd+UZd3lYREIZ7/9x7Gu5fZootXdvX/efFaoCr9UOXvC5uzZeW9jeZOuy4Xb72tkdXUTlCt6C9JuMJGKVzmKbZexK4XuE+lr8aIewNphXAwLDOa4e1FYVJEzaMLkINNeW7ZPIt3zhDO9W/KT17Ktzv8aNmx5X1G6vBmgq35AQKBgQDaKNh7/HUZz5owVNb6SI/09v5crV4zM6wz8K+Wl3SIGmMleqytxH01UBDQinlgerZ+JtI7X19h/NF3OVR2h0E38Mgg4CLZOYiWCRT8d14BhzBeF/kp5bGVBbEMCem3dJK9EMyapkXS7GkjWKgIFA0XAdJCENXomtxm3/C52AzFsQKBgQCpIoMVbI9SywJ/BE5sZGuwMiedxkr39cw8WsDUr0EQzoEBgz6UVpV1Z2bmIP7ri8jkD5CGYEJXcFpRLV2xogb9Hw6Pklsrri0d4NSDuBg2vxtlTyBRBtqyiC9ihg6lqfUrb0gtexCkosYoWxUdO9YPOYzV3Oc8tT7KbRdwP0GwjwKBgA3H/sT2Ub9rqeXbtijhZJao87CPEyBQ51PwpGby8l2WrSS09yuS+gXgJO/Hj5tUpSqa8TTm9XOPMPxDFt7V9HzALSRGhG0MgWBY+oZoU/vsulV3VjobVHiBf4mvJqB8MLjY0tQCJO8KGCovc43vFlSZvNqHjbu/7KRjCSX0S/pBAoGAWbBcdMLxqcTPmQ1ujNofpPqjuW3KmXz1hdfWQ7J/vWrUTDoNuFnFvdFMZqJ+q+efaxi52hg3dei1bDCza5vxOs76SLYitKITeLGd4A+Cf52N6IYyK+WHmX7QKd3O7JiY0ySa0Mtewv8yN3o9UxhE5iPthAc1dCLknjGFaVeR/Q8CgYBYL1oWXFjxs9sjJ1iBEHw2UzJNdaHityvEi+9PjCLwqfxB6bNeFGPZx3Uy5voxHTu3+AwrNHcLEiWPylqJ/42/8cHbYQ2uZ7Hu3z4bqU7JxvIpbH7MXuoXeBikvbr9qUoXNcT+7pWGL0WjKmz1AfP39HheZi06QcEs0QFHQgBkDg==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAraBx4HT67ffPxfHFCHjGE4fbJPMKHgMvigX5zI7pXCW4IGL27UtwJXlFpPvkcR6JXlX93blcnFK5qM7Ny6PJ2yMihAkqd7DeJ1JvnLpyp55If6lk1WK1am9CeZv0uQUbx1m3QKZiCs6YEv2MrVJj6KbCkDBptZjhG+gNsqwPzyFzZxXiZRnUKX25Dk9l5kfgayzzTdwzzAB27BcOK0Jq8cy44eDDwl6SLScFKyv7gjjJ6DBsulcVtX41GgANbMBKWMUyh/UPt/Tbg1FIkTudX0oakKht696+qrcB43+BIBNu0jYhOlDJWt8h/FNDDQ+xG6fNJlVghw2EkTgkvjozOQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8081/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8081/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
	

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }


	public static String getApp_id() {
		return app_id;
	}


	public static String getMerchant_private_key() {
		return merchant_private_key;
	}


	public static String getAlipay_public_key() {
		return alipay_public_key;
	}


	public static String getNotify_url() {
		return notify_url;
	}


	public static String getReturn_url() {
		return return_url;
	}


	public static String getSign_type() {
		return sign_type;
	}


	public static String getCharset() {
		return charset;
	}


	public static String getGatewayUrl() {
		return gatewayUrl;
	}


	public static String getLog_path() {
		return log_path;
	}
}

